#pragma once
#include "MyEffect.h"

class Shadow :	public MyEffect
{
private:
	int _xMove;
	int _yMove;

public:
	Shadow(void)
	{
		_xMove = 0;
		_yMove = 0;
	}
	
	Shadow(int moveOfX, int moveOfY)
	{
		_xMove = moveOfX;
		_yMove = moveOfY;
	}

	~Shadow(void)
	{
	}

	Shadow(int x, int y, int width, int height, char stroke[], int strokeWidth, char fill[])
	{
	}

	void SetMove(int moveOfX, int moveOfY)
	{
		_xMove = moveOfX;
		_yMove = moveOfY;
	}

	string GetName()
	{
		return "Shadow";
	}

	void DrawEffect(MyGraphics* g)
	{
		// Chu y: Vi tri cua doi tuong THIS luc nay la vi tri ma doi tuong no chua

		// Giu lai mau to va vi tri ban dau doi tuong no chua (_shape)
		char oldColor[3];
		MyPoint oldPosition;

		_shape->GetFillColor(oldColor);
		oldPosition = _shape->GetPosition();

		// Cap nhat mau to bong va vi tri moi cho _shape
		_shape->SetFillColor(_color);
		_shape->SetPosition(oldPosition.x + _xMove, oldPosition.y + _yMove);

		//yeu cau no ve shadow voi vi tri moi
		_shape->Fill(g);

		// Tra lai mau to va vi tri ban dau cho _shape
		_shape->SetFillColor(oldColor);
		_shape->SetPosition(oldPosition.x, oldPosition.y);
	}
};

